package com.fast.develop.configuration.registor;

import com.fast.develop.configuration.resource.MetaDbFileMultResource;
import com.fast.develop.core.io.db.DbResourceRepository;
import com.fast.develop.meta.base.MetaRegistor;
import com.fast.develop.meta.base.reader.SchemaFileReader;
import com.fast.develop.meta.base.reader.SchemaReader;
import com.fast.develop.meta.dm.MetaDomainConstant;
import com.fast.develop.meta.dm.loader.MetaModelLoader;

/**
 * @author 莫寅
 * @createTime 2022-06-15 14:54
 * @desc：
 */
public class MetaDomainDbRegistor implements MetaRegistor {


    private DbResourceRepository dbResourceRepository;

    public MetaDomainDbRegistor(DbResourceRepository dbResourceRepository) {
        this.dbResourceRepository = dbResourceRepository;
    }



    @Override
    public SchemaReader getSchemaReader() {
        return new SchemaFileReader(new MetaDbFileMultResource(dbResourceRepository), new MetaModelLoader());
    }


    @Override
    public String type() {
        return MetaDomainConstant.TYPE;
    }
}
